<template>
	<view>
		<view class="c-box-nobg">
			<c-label title="职位信息"></c-label>
		</view>
		<view class="c-box-nobg">
			<view class="fl jsp">
				<view >{{detail.name}}</view>
				<view class="t-r">￥{{detail.salary}}</view>
			</view>
			<view class="mt8 fs26">
				{{detail.obligation}}
			</view>
			<view class="mt8 fl fs26">
				<u-icon name="map"></u-icon>
				<text>{{detail.address}}</text>
			</view>
			<view class="mt8">
				联系人:{{detail.contacts}}
			</view>
		</view>
		<view class="c-box-nobg">
			<c-label title="公司信息"></c-label>
		</view>
		<view class="c-box-nobg">
			<u-divider text="公司简介"></u-divider>
		</view>
		<view class="fl jcc">
			<h3>{{company.companyName}}</h3>
		</view>
		<view class="c-box-nobg">
			{{company.introductory}}
		</view>
		<view class="c-box-nobg mt100">
			<u-button type="primary" text="投简历" ></u-button>
		</view>
	</view>
</template>
第一部分显示信息包括职位名称、岗位职责、公司地点、薪资待遇、联系人、职位描述、职位需求；第二部分显示公司信息包括公司名称、公司简介
<script setup>
	import {onLoad} from '@dcloudio/uni-app'
import { ref } from 'vue';
import { getCompanyDetailAPI, getDetailAPI } from '../../../api/job';
	const id =ref()
	const detail =ref({})
	const getDetail =async ()=>{
		const res =await getDetailAPI(id.value)
		detail.value =res.data
		getCompany()
	}
	const company =ref({})
	const getCompany =async()=>{
		const res =await getCompanyDetailAPI(detail.value.companyId)
		console.log(res);
		company.value =res.data
	}
	onLoad((options)=>{
		id.value=options.id
		getDetail()
	})
</script>

<style>

</style>
